package com.BCM.service.impl;

import com.BCM.dao.GradeDao;
import com.BCM.po.Grade;
import com.BCM.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tanghao
 */
@Service
public class GradeImpl implements GradeService {
    @Autowired
    private GradeDao gradeDao;
    @Override
    public List<Grade> findAllGrade() {



        return this.gradeDao.findAllGrade();
    }

    @Override
    public int deleteGrade(int gradesId) {
        int num=this.gradeDao.deleteGrade(gradesId);
        return num;
    }

    @Override
    public Grade findGradeBygradesId(int gradesId) {
        return this.gradeDao.findGradeBygradesId(gradesId);
    }



    @Override
    public int updateGrade(Grade grade) {
        return this.gradeDao.updateGrade(grade);
    }

    @Override
    public void save(Grade grade) {
        gradeDao.save(grade);
    }

    @Override
    public List<Grade> findGradeByusername(String username) {
        List<Grade> grades= this.gradeDao.findGradeByusername(username);
        for (Grade order:grades){
            System.out.println("service"+order);
        }
        return grades;
    }

    @Override
    public List<Grade> findGradeBystudentClass(String studentClass) {
        List<Grade> grades= this.gradeDao.findGradeBystudentClass(studentClass);
        return grades;
    }
}



